package tmp.arno.Merger;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class MapBrand {
	public static void main(String[] args) throws SQLException {
		Connection con=DAO.DbcpConnection.getConnection();
		Statement st=con.createStatement();
		ResultSet rs=st.executeQuery("select * from map_brand");
		PreparedStatement pst=con.prepareStatement("update all_detail set brandFixed=? where brandfixed is null and brand like ?");
		int i=0;
		while (rs.next()) {
			System.out.println(i++);
			//String fromBrand=rs.getString("from");
			String toBrand=rs.getString("to");
			pst.setString(1, toBrand);
			pst.setString(2, "%"+toBrand+"%");
			pst.execute();
		}
		//pst.executeBatch();
	}
}
